import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

  const routes = [
  {
    path: '/home',
    name: 'Home',
    component: Home
  },
  {
    path: '/about',
    name: 'About',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  },
  {
    path: '/colorPicker',
    name: 'ColorPicker',
    component: () => import(/* webpackChunkName: "colorPicker" */'../views/colorPicker.vue')
  },
  {
    path: '/G2-line-inter',
    name: 'G2折柱',
    component: () => import(/* webpackChunkName: "G2-line-inter" */'../views/G2-折柱.vue')
  },
  {
    path: '/G2-line',
    name: 'G2多折线',
    component: () => import(/* webpackChunkName: "G2-line" */'../views/G2-多折线.vue')
  },
  {
    path: '/G2-pie',
    name: 'G2饼图',
    component: () => import(/* webpackChunkName: "G2-pie" */'../views/G2-饼图.vue')
  },
  {
    path: '/G2-nested-pie',
    name: 'G2嵌套饼图',
    component: () => import(/* webpackChunkName: "G2-nested-pie" */'../views/G2-嵌套饼图.vue')
  },
  {
    path: '/G2-group-bar',
    name: 'G2-分组柱状图',
    component: () => import(/* webpackChunkName: "G2-group-bar" */'../views/G2-分组柱状图.vue')
  },
  {
    path: '/G2-radar',
    name: 'G2-雷达图',
    component: () => import(/* webpackChunkName: "G2-radar" */'../views/G2-雷达图.vue')
  },
  {
    path: '/G2-area',
    name: 'G2-面积图',
    component: () => import(/* webpackChunkName: "G2-area" */'../views/G2-面积图.vue')
  },
  {
    path: '/G2-bar-chart',
    name: 'G2-条形图',
    component: () => import(/* webpackChunkName: "G2-bar-chart" */'../views/G2-条形图.vue')
  },
  {
    path: '/G2-ring',
    name: 'G2-环图',
    component: () => import(/* webpackChunkName: "G2-ring" */'../views/G2-环图.vue')
  },
  {
    path: '/el-quarter',
    name: '季度选择器',
    component: () => import(/* webpackChunkName: "G2-ring" */'../views/季度选择器.vue')
  },
  {
    path: '/el-lazy-tree',
    name: '懒加载树',
    component: () => import(/* webpackChunkName: "G2-ring" */'../views/懒加载树.vue')
  },
  {
    path: '/vue-table-scroll',
    name: '表格自动轮播',
    component: () => import(/* webpackChunkName: "G2-ring" */'../views/表格自动轮播.vue')
  },
  {
    path: '/vue-table-drag',
    name: '表格拖拽排序',
    component: () => import(/* webpackChunkName: "G2-ring" */'../views/表格拖拽排序.vue')
  },
  {
    path: '/vue-preview-word',
    name: '预览word',
    component: () => import(/* webpackChunkName: "G2-ring" */'../views/预览word.vue')
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [{
    path: '/',
    name: 'main',
    component: () => import('../views/main.vue'),
    children: routes
  }]
})

export default router
